package com.xpc.test.base;

import cn.hutool.http.HttpStatus;
import lombok.Data;

/**
 * 功能描述：公用的返回信息
 *
 * @author xpc on 2024/4/2 10:03
 */
@Data
public class ResultMessage {
    private int code;
    private String message;

    public static ResultMessage ok(String message) {
        ResultMessage resultDto = new ResultMessage();
        resultDto.setCode(HttpStatus.HTTP_OK);
        resultDto.setMessage(message);
        return resultDto;
    }

    public static ResultMessage error(String message) {
        ResultMessage resultDto = new ResultMessage();
        resultDto.setCode(HttpStatus.HTTP_INTERNAL_ERROR);
        resultDto.setMessage(message);
        return resultDto;
    }

    public ResultMessage() {
    }
}
